import type { AppRouteModule } from '/@/router/types';

import { LAYOUT } from '/@/router/constant';
import { t } from '/@/hooks/web/useI18n';

const workFlow: AppRouteModule = {
  path: '/workFlow',
  name: 'workFlow',
  component: LAYOUT,
  redirect: '/workFlow/flowManager',
  meta: {
    orderNo: 8,
    icon: 'material-symbols:flowsheet-outline',
    title: t('routes.demo.workFlow.workFlow'),
  },
  children: [
    {
      path: 'flowManager',
      name: 'flowManager',
      component: LAYOUT,
      redirect: '/flowManager/flowTemplate',
      meta: {
        title: t('routes.demo.workFlow.flowManager'),
      },
      children: [
        {
          path: 'flowTemplate',
          name: 'flowTemplate',
          meta: {
            title: t('routes.demo.workFlow.flowTemplate'),
            ignoreKeepAlive: false,
          },
          component: () => import('/@/views/demo/workFlow/index.vue'),
        },
        {
          path: 'flowModel',
          name: 'flowModel',
          meta: {
            title: t('routes.demo.workFlow.flowModel'),
            ignoreKeepAlive: false,
            hideMenu: true, // 是否隐藏菜单
          },
          component: () => import('/@/views/demo/workFlow/flowModel.vue'),
        },
        {
          path: 'flowComponent',
          name: 'flowComponent',
          meta: {
            title: t('routes.demo.workFlow.flowComponent'),
            ignoreKeepAlive: false,
            hideMenu: true, // 是否隐藏菜单
          },
          component: () => import('/@/views/demo/workFlow/flowComponent.vue'),
        },
      ],
    },
    {
      path: 'flowApproval',
      name: 'flowApproval',
      component: LAYOUT,
      redirect: '/flowApproval/flowDone',
      meta: {
        title: t('routes.demo.workFlow.flowApproval'),
      },
      children: [
        {
          path: 'flowToDo',
          name: 'flowToDo',
          meta: {
            title: t('routes.demo.workFlow.flowToDo'),
            ignoreKeepAlive: false,
          },
          component: () => import('/@/views/demo/workFlow/flowToDo.vue'),
        },
        {
          path: 'flowDone',
          name: 'flowDone',
          meta: {
            title: t('routes.demo.workFlow.flowDone'),
            ignoreKeepAlive: false,
          },
          component: () => import('/@/views/demo/workFlow/flowDone.vue'),
        },
        {
          path: 'flowExample',
          name: 'flowExample',
          meta: {
            title: t('routes.demo.workFlow.flowExample'),
            ignoreKeepAlive: false,
            hideMenu: true,
          },
          component: () => import('/@/views/demo/workFlow/flowExample.vue'),
        },
      ],
    },
  ],
};

export default workFlow;
